package exception;

import java.awt.*;
import java.io.FileNotFoundException;
import java.io.IOException;

public class ThrowsDemo {
    public static void doSome() throws IOException, AWTException {}
}

class SubClass extends ThrowsDemo{
    //允许仅抛出部分异常
    //public static void doSome() throws IOException {}

    //允许不再抛出异常
    //public static void doSome(){}

    //允许抛出超类方法抛出异常的子类型异常
    //public static void doSome()throws FileNotFoundException {}

    //不允许抛出额外异常(超类方法没有抛出的, 并且也不存在继承关系的异常)   报错
    //public static void doSome()throws SQLException {}

    //不允许抛出超类方法抛出异常的超类异常   报错
    //public static void doSome()throws Exception {}
}
